package com.circles.notifications.dao.sqlmap;

import java.util.HashMap;
import java.util.List;

import org.apache.ibatis.session.SqlSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.circles.notifications.dao.NotificationsDao;
import com.circles.notifications.entity.NotificationsDto;

@Repository
public class SqlMapNotificationsDao implements NotificationsDao {

	@Autowired
	private SqlSession sqlSession;
	
	@Override
	public int writeGroupService(HashMap<String, String> map) {
		return sqlSession.insert("NotificationsMapper.writeGroupService", map);
	}

	@Override
	public int getNotiCount(String userNum) {
		return sqlSession.selectOne("NotificationsMapper.getNotiCount", userNum);
	}

	@Override
	public List<NotificationsDto> getNotiList(String userNum) {
		return sqlSession.selectList("NotificationsMapper.getNotiList", userNum);
	}

	@Override
	public void setRead_check(String userNum) {
		sqlSession.update("NotificationsMapper.setRead_check", userNum);
	}

}
